package PTA.javabianchengjichu2;

import java.util.Scanner;

public class ex26 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int Sumprice = 0;
        int time = sc.nextInt();
        if(time<=120&&time>=0){
            Sumprice =time*20;
        }else if(time>120){
            Sumprice=2400+(time-120)*40;
        }
        System.out.println(Sumprice);

    }
}
